<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/commons/jsp/taglibs.jsp"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="keywords" content="">
<meta http-equiv="Cache-Control" content="max-age=86400 public">
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="X-UA-Compatible" content="IE=9">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<script type="text/javascript" src="${ctx }/web/js/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="${ctx }/web/js/1.js"></script>
    <script type="text/javascript" src="${ctx }/web/js/2.js"></script>
    <script type="text/javascript" src="${ctx }/web/js/lubotu.js"></script>
    <link href="${ctx }/web/css/style.css" rel="Stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="${ctx }/web/css/basic.css">
</head>
<body>
<div class="clearfix">
<div class="banbo clearfix">
    <div class="test" >
    <%@ include file="web-top.jsp"%>
        <div class="mainbg">
        <div class="clearfix">
            <!--- 内容区 --->
            <div title="内容区" style="width: 100%;">
		            	<div class="map_txt" style="width: 98%;height: 30px; padding-top: 30px;font-size: 14px;padding-left: 20px; margin:0 auto 20px; border-bottom:1px solid #dedede;">
		                	当前位置 : <a href="${ctx }" target="_blank">首页</a>  >  搜索结果  
		                </div>
                <div title="展示区" style="width:100%; float: left;">
                    <!---办公文具--->
                    <div style="height: 40px;width: 700px;padding-left: 10px;"> 
			            <ul class="array">
			              <li ${empty sortValue?"class='selected'":"" }><a href="javascript:void(0)"  onClick="sort(3);" title="默认排序">默认</a></li>
			              <li ${sortValue=='4'?"class='selected'":"" }><a href="javascript:void(0)"  onClick="sort(4);" title="点击按综合销量从高到低+价格从低到高">综合</a></li>
			              <li ${sortValue=='3'?"class='selected'":"" }><a href="javascript:void(0)"  onClick="sort(3);" title="点击按销量从高到低排序">销量</a></li>
			              <li ${sortValue=='2'?"class='selected'":"" }><a href="javascript:void(0)"  onClick="sort(2);" title="点击按人气从高到低排序">人气</a></li>
			              <li ${sortValue=='1'?"class='selected'":"" }><a href="javascript:void(0)"  onClick="sort(1);" title="点击按上架时间从高到低排序">上架</a></li>
			              <li ${sortValue=='0'?"class='selected'":"" }><a href="javascript:void(0)"  onClick="sort(0);" title="点击按价格从低到高排序">价格</a></li>
			            </ul>
			            <div style="display: block;float: left;padding: 4px 8px 4px 4px;margin-top: 6px;"> 
			              <div style="float: left;">
			              <em>&yen;</em>
			              <input  type="text" style="width: 30px;" id="startPriceData" value="${startPrice }" />
			              <em>-</em>
			              <input type="text" style="width: 30px;" id="endPriceData" value="${endPrice }" />
			              </div>
			              <input id="search_by_price" type="submit" value="确认" onclick="selectPriceRange();" style="line-height: 18px;color: #999;background-color: #eee;text-align: center;display: block;width: 36px;margin-left: 6px;border: solid 1px;border-color: #d0d0d0d #d0d0d0d #ababab #d0d0d0;cursor: pointer;float: left; "/>
			            </div>
			          </div>
            		<div class="bango" style="height:auto;padding: 8px;">
				         <div class="shangchen clearfix" id="goods_list">
				        	<ul>
								 <c:forEach items="${webDtos}" var="web" varStatus="status">
								        <li> <a href="${ctx }/web/goodsInfo?goodsId=${web.id}" title="${web.goodsName}" target="_blank">
							                <img src="${ctx}/file_resource${web.picPath}" style="border: 0; width: 178px;height: 178px; background:#fff;" alt="IMG" />
							               <div style="height: 40px;width: 100%;padding-top: 6px; text-align:left;">
							               <c:choose>
							               	<c:when test="${fn:length(web.goodsName)>26 }">${fn:substring(web.goodsName,0,26)}...</c:when>
							               	<c:otherwise>${web.goodsName}</c:otherwise>
							               </c:choose>
							               </div>
							               </a>
							                <div style="height: 30px;width: 100%;">
							                    <span style=" color:#999;">商城价:</span>&nbsp;<span id="Span2">￥</span><span id="Span2">${web.sellPrice}</span>&nbsp;<c:if test="${web.grads == '1'}"><span class="honge02">梯度</span></c:if>  
							                </div>
							                <div style="height: 30px;width: 100%;">
							                    <span style=" color:#999;">${web.shopName }</span>
							                </div>
							            </li>
								  </c:forEach>
							</ul>
				        
				         </div>
               		</div>
               		<!-- 分页实现区 -->
               		
						 <div class="pagination" style="padding-left: 20px;"><ul><li>
						 <c:choose>
						 	<c:when test="${page.pageNo == 1}"><span style="color: #ccc;">首页</span></c:when>
						 	<c:otherwise><a href='javascript:void(0);' onclick="goPage(1)"><span style="color: #ccc;">首页</span></a></c:otherwise>
						 </c:choose>
						 </li><li>
						 <c:choose>
						 	<c:when test="${page.pageNo > 1}"><a href='javascript:void(0);' onclick="goPage(${page.pageNo-1})"><span style="color: #ccc;">上一页</span></a></c:when>
						 	<c:otherwise><span style="color: #ccc;">上一页</span></c:otherwise>
						 </c:choose>
						 </li>
						 <c:choose>
						 	<c:when test="${page.totalPages<6}">
						 		<c:forEach begin="1" end="${page.totalPages}" var="p">
						 			<c:choose>
						 				<c:when test="${p==page.pageNo}"><li><span class="currentpage" style="color: #ccc;">${p }</span></li></c:when>
						 				<c:otherwise><li><a href='javascript:void(0);' onclick="goPage(${p})"><span style="color: #ccc;">${p }</span></a></li></c:otherwise>
						 			</c:choose>
						 		</c:forEach>
						 	</c:when>
						 	<c:otherwise>
						 		<c:choose>
						 			<c:when test="${page.pageNo>3 && page.totalPages>=page.pageNo+2}">
						 				<c:forEach begin="${page.pageNo-2}" end="${page.pageNo+2}" var="p">
								 			<c:choose>
								 				<c:when test="${p==page.pageNo}"><li><span class="currentpage" style="color: #ccc;">${p }</span></li></c:when>
								 				<c:otherwise><li><a href='javascript:void(0);' onclick="goPage(${p})"><span style="color: #ccc;">${p }</span></a></li></c:otherwise>
								 			</c:choose>
								 		</c:forEach>
						 			</c:when>
						 			<c:when test="${page.pageNo>3 && page.totalPages<page.pageNo+2}">
						 				<c:forEach begin="${page.totalPages-4}" end="${page.totalPages}" var="p">
								 			<c:choose>
								 				<c:when test="${p==page.pageNo}"><li><span class="currentpage" style="color: #ccc;">${p }</span></li></c:when>
								 				<c:otherwise><li><a href='javascript:void(0);' onclick="goPage(${p})"><span style="color: #ccc;">${p }</span></a></li></c:otherwise>
								 			</c:choose>
								 		</c:forEach>
						 			</c:when>
						 			<c:otherwise>
						 				<c:forEach begin="1" end="5" var="p">
								 			<c:choose>
								 				<c:when test="${p==page.pageNo}"><li><span class="currentpage" style="color: #ccc;">${p }</span></li></c:when>
								 				<c:otherwise><li><a href='javascript:void(0);' onclick="goPage(${p})"><span style="color: #ccc;">${p }</span></a></li></c:otherwise>
								 			</c:choose>
								 		</c:forEach>
						 			</c:otherwise>
						 		</c:choose>
						 	</c:otherwise>
						 </c:choose>
						 <li>
						 <c:choose>
						 	<c:when test="${page.pageNo<page.totalPages}"><a href='javascript:void(0);' onclick="goPage(${page.pageNo+1})"><span style="color: #ccc;">下一页</span></a></c:when>
						 	<c:otherwise><span style="color: #ccc;">下一页</span></c:otherwise>
						 </c:choose>
						 </li><li>
						 <c:choose>
						 	<c:when test="${page.pageNo==page.totalPages}"><span style="color: #ccc;">末页</span></c:when>
						 	<c:otherwise><a href='javascript:void(0);' onclick="goPage(${page.totalPages})"><span style="color: #ccc;">末页</span></a></c:otherwise>
						 </c:choose>
						 </li></ul> </div>
                    </div>
                </div>
            </div>
        </div>
        <%@ include file="web-buttom.jsp"%>
        </div>
    </div>
</div>
</div>
<form action="${ctx }/web/goodsSelect" method="post" id="selectGoodsForm">
	<input type="hidden" id="goodsName" name="goodsName" value="${goodsName }"/>
	<input type="hidden" id="pageNo" name="pageNo" value="${page.pageNo }"/>
	<input type="hidden" id="sortValue" name="sortValue" value="${sortValue }"/>
	<input type="hidden" id="startPrice" name="startPrice" value="${startPrice }"/>
	<input type="hidden" id="endPrice" name="endPrice" value="${endPrice }"/> 
	<input type="hidden" name="selName" value="${selName }"/>
</form>
</body>
</html>
<<script type="text/javascript">
<!--
	function sort(v){
		$('#sortValue').val(v);
		$('#selectGoodsForm').submit();
	}

	function goPage(pageNo){
		$('#pageNo').val(pageNo);
		$('#selectGoodsForm').submit();
	}

	function selectPriceRange(){
		$('#startPrice').val($('#startPriceData').val());
		$('#endPrice').val($('#endPriceData').val());
		$('#selectGoodsForm').submit();
	}
//-->
</script>
